package com.authsphere.security.social.wechat;

import me.zhyd.oauth.config.AuthConfig;
import me.zhyd.oauth.request.AuthRequest;
import me.zhyd.oauth.request.AuthWeChatOpenRequest;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @program: AuthSphere
 * @description:
 * @author: YuKai Fan
 * @create: 2025/3/25 09:31
 **/
@Configuration
public class SocialWechatConfiguration {

    @Bean
    @ConfigurationProperties(prefix = "authsphere.security.social.wechat")
    public AuthConfig wechatConfig() {
        return new AuthConfig();
    }

    @Bean(name = "wechat_open")
    public AuthRequest alipayAuthRequest(final AuthConfig wechatConfig) {
        return new AuthWeChatOpenRequest(wechatConfig);
    }
}
